﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace ModelViews
{
    static public class CompareDatabaseModelView
    {
        static public DataTable GetAllDatabase(string server, bool Authentication, string catalog, string login, string password)
        {
            return Models.CompareDatabaseModel.GetAllDatabase(server, Authentication, catalog, login, password);
        }

        static public DataTable CompareTable(Models.DataModel conn1, Models.DataModel conn2,int type)
        {
            string columns = string.Empty;
            switch(type)
            {
                case 1:
                    columns = Models.CompareDatabaseModel.Table_Index;
                    break;
                case 2:
                    columns = Models.CompareDatabaseModel.Table_Identity;
                    break;
                default:
                    columns = Models.CompareDatabaseModel.Table_Define;
                    break;
            }            
            DataTable tb1 = Models.CompareDatabaseModel.GetTableInfo(conn1,type);
            DataTable tb2 = Models.CompareDatabaseModel.GetTableInfo(conn2,type);
            return Models.CompareDatabaseModel.CompareTable(tb1, tb2, columns,type);
        }
    }
}
